#include "yscheckbox.h"

#include <QPainter>
#include <mainwindow.h>

YSCheckBox::YSCheckBox(QColor textColor, QWidget *parent):
    QCheckBox(parent)
{
    setStyleSheet(QString("QCheckBox::indicator { width: %1px; height: %1px; margin-top:%2px}"
                          "QCheckBox::indicator:unchecked{  \
                        border-image: url(:/images/uncheck.png); \
                    }\
                    QCheckBox::indicator:checked{ \
                    border-image:url(:/images/check.png); \
                    }\
                    QCheckBox{ \
                    color: %4;\
                    font:%3px \"微软雅黑\";\
                    }").arg(int(24*g_xScale)).arg(int(3*g_xScale)).arg(int(20*g_xScale)).arg(textColor.name()));
}

YSCheckBox::YSCheckBox(QColor textColor,const QString &text, QWidget *parent):
    QCheckBox(parent)
{
    setText(text);
    setStyleSheet(QString("QCheckBox::indicator { width: %1px; height: %1px; margin-top:%2px}"
                          "QCheckBox::indicator:unchecked{  \
                        border-image: url(:/images/uncheck.png); \
                    }\
                    QCheckBox::indicator:checked{ \
                    border-image:url(:/images/check.png); \
                    }\
                    QCheckBox{ \
                    color: %4;\
                    font:%3px \"微软雅黑\";\
                    }").arg(int(24*g_xScale)).arg(int(3*g_xScale)).arg(int(20*g_xScale)).arg(textColor.name()));
}

